package com.cuiweiyou.bluemesh.bluetooth;

import com.cuiweiyou.bluemesh.model.LightModel;

import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class BluetoothRssiSortor {

    private BluetoothRssiSortor() {
    }

    /**
     * 根据信号强度排序
     */
    public static void sortDevicesByRssi(Map<String, List<LightModel>> bluetoothDeviceMap) {
        Iterator<String> iterator = bluetoothDeviceMap.keySet().iterator();
        while (iterator.hasNext()) {
            String groupName = iterator.next();
            List<LightModel> lightModels = bluetoothDeviceMap.get(groupName);
            Collections.sort(lightModels);
        }
    }
}
